/*
 * @Date: 2022-07-04 14:09:30
 * @LastEditors: 大濕兄
 * @LastEditTime: 2022-07-04 15:24:24
 * @name: 
 * @FilePath: \gutu-projecktc:\Users\Administrator\Desktop\my-vue-app\vite.config.ts
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const path: any = require('path');
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  base: './', // 添加这个属性
  resolve: {
    // 配置路径别名
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
  server: {
    proxy: {
      '/api': {
        target: 'https://test/api',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  },
})
